Extended memory is a technique that allows you increase the amount of application memory without adding physical RAM. There are two common types, RAM doubling and virtual memory.
RAM Doubling is a technique that improves the efficiency with which your current RAM is used and compresses some infrequently-used parts of RAM to make extra space. It exactly doubles the amount of application memory available, generally with no appreciable impact on the speed of your Macintosh.
Virtual memory allows you to transform some of your (inexpensive) hard drive space into (more valuable) application memory. Parts of memory that are infrequently used are stored on the hard disk and made available to the Systems as if they were in RAM when needed. Virtual memory slows down your computer because these data accesses occur at hard dive speeds instead of RAM speeds. The advantage of virtual memory is that it can more than double your application memory.
To use extended memory you need a Memory Management Unit (MMU). This is built into the 68030, 68040 and PowerPC processors. So the Classic II, SE/30, most Mac-II series, most Performas, most LCs, all Centris, all Quadra and all Power Mac systems can run extended memory without modification. See the later chapters for information about your system.
The two techniques cannot be used simultaneously. Most users will be best served by RAM doubling unless large increases in memory are occasionally required and speed is not important.
RAM Doubling
RAM Doubling was introduced to the Macintosh in January, 1994 in the form of the award-winning product, Connectix RAM Doubler. This quickly became one of the fastest-selling products in the history of the Mac because it simply gives users an exact doubling of memory with no appreciable speed impact, no controls to adjust, and an easy 15-second installation. It is the only RAM doubling product available in the personal computer industry; Windows and OS/2 versions are in development at Connectix.
RAM Doubler works by successively applying three techniques: First, it finds memory that has been allocated to open applications but is not currently in use. For example, 4MB may have been assigned to Microsoft Word at launch time, but only 2.5MB is currently being used by the application and the Word document(s that are open. RAM Doubler lets the Mac use the remaining 1.5MB for something else, giving it back to Word only if Word needs it (and doing it in a way that is invisible to you so you don't have to worry about it). If you look at the “About This Macintosh” display (go into the Finder and pull down the Apple menu), RAM Doubler gives all the white parts of those bars back to the operating system to use opening other applications.
Second, if that is not enough to fully double memory, RAM Doubler finds parts of memory that are actually in use (the “black bars" in About this Macintosh) but contain software that is unlikely to be needed again. This is usually "execute-once-only" code that was used to boot the computer or launch an application already. It compresses this part of memory to create the extra space needed for a full double. Typically it can compress three megabytes of memory into one, though this ratio varies according to the type of information it compresses.
Third, if RAM Doubler would need to compress too much memory in order to double (i.e.. you would wind up with poor performance) it occasionally parks some compressed data on the hard drive using techniques similar to, but much faster than System 7 VM (see below). This usually only happens on Macs with less than 8MB of RAM and rarely involves more than a few hundred Kilobytes (100K) of data.
The result is a true doubling of application memory, usually with no appreciable affect on performance.
Virtual Memory
Virtual memory works by keeping some of the information normally stored in RAM in a special file on the hard drive known as the swap file or backing store. This technique works fairly well with the Macintosh operating system since the foreground application can be given most of the real RAM and the background applications can be “swapped out” to the hard drive, ready to be copied up to RAM whenever they are brought to the foreground. The important parameter is the ratio between the amount of real RAM not being used by the System (that is, the physical RAM minus 2MB or so) as compared to the size of the largest single application you want to run. As long as the RAM amount is larger, virtual memory should not significantly slow down your computer.
Connectix first brought this technology to the Macintosh in 1988 with its award–winning product, Virtual, and today "VM" is a standard feature of System 7.
Generally the speed advantages of RAM doubling outweigh the flexibility of virtual memory (i.e.. you can more than double), so the main reason to use virtual memory is that it comes free with your computer! If you only infrequently need memory extension, System 7 VM may be an adequate solution for you. If you regularly need more memory you will want to consider RAM doubling.
If you do use System 7 VM, you may be able to slightly improve its performance by making sure the swap file is contiguous. The best way to do this is to optimize your drive with one of the major hard drive utilities.
Original Mac II: Purchasing PMMUs
The original 68020–based Mac II requires a Motorola 68851 Paged Memory Management Unit (PMMU) in order to run System 7 VM, A/UX, MODE32, Connectix Virtual, RAM Doubler or Connectix MAXIMA unless the Mac II has been upgraded with a 68030 or 68040 processor. The Mac II incorporates a motherboard socket specifically designed for this memory coprocessor. The current (and final) shipping version of the Paged Memory Management Unit is the Mask 73 Motorola MC68851RC16A. This is the version which Apple carries on its parts list. Surplus parts of earlier versions (Masks) may be available, but may not work properly.
The Mask number can be identified by looking at the second line on the chip. The first or second digit on this line should be a letter “B.” The Mask number is found in the two digits that follow the “B.” All parts shipped by Motorola since March, 1989 are Mask 73. Earlier generations (in reverse chronological order) were Mask 36, 96, and 87. These are not recommended for use with the Macintosh.
PMMUs are also available in different speed ratings. This is designated by the number after the letters RC on the first line. The Mac II is clocked at 16MHz, so it needs a 16MHz PMMU. Do not buy a PMMU with an RC number less than that. So, for example an MC68851RC16A is a good part, but an XC68851RC12 is not. Some RC12 parts are available on the market for a low price, but these are likely to produce intermittent crashes after days, weeks, or months of use.
Using Large Amounts of Memory
Things are pretty simple on any PowerBook or Modular Mac as long as you don’t need more than 8MB of memory, or on a Compact Mac if you are satisfied with 4MB. In this case just follow the four SIMM rules (see “About SIMMs”). But, if you are doing high–end graphics, animation, CAD, modeling, or any of the plethora of memory–intensive Mac jobs, then you may need special software to use high memory.
24-Bit Addressing Memory Limitations
When you install more memory in your Macintosh or use extended memory, sometimes the operating system sometimes does not recognize that the memory is there. This is usually because the 24–bit addressing mode (standard on System 6, optional on some Macs in some version of System 7) can only use 8MB of memory on a Modular Mac, or 4MB on a Compact Mac.
The two basic ways to deal with this on a Modular Mac are to use 32–bit addressing (see "32-bit Addressing"). To activate this, open the System 7 Memory Control Panel and turn on 32-Bit Addressing. The 32–bit addressing mode allows a Modular Mac to use up to 1024MB of RAM. Only “32–bit clean” applications and extensions will run in the 32–bit mode, but almost all Mac products shipped since January, 1993 are 32-bit clean.
Using More Than 4MB On Compact Macintoshes
The 68000–based Compact Macs, the Plus, SE, and Classic, cannot use 32–bit addressing but there are good 24–bit alternatives.
The Mac Plus, SE and Classic are normally limited to 4MB. This can be a serious handicap, particularly under System 7. (This is not true of the Classic II nor the SE/30–see below.) Moreover, there is no support for 32–bit addressing mode on these Macs because of design limitations of the 68000 CPU. However, these three systems can use 16MB of physical RAM (four 4MB SIMMs) when the Mac is equipped with a compatible 68030 accelerator card and Compact Virtual 3.0. This is accomplished in 24–bit mode and does not require using virtual memory.
If the accelerated Compact Mac has less than 16MB of physical RAM, Compact Virtual can create up to 16MB using virtual memory. Whether physical or virtual memory is used, Compact Virtual reorganizes the memory map so up to 12MB of the 16MB is contiguous (see “32-Bit Addressing/Memory Fragmentation”).
68030–accelerator cards are available today for the Mac Plus, SE, and Classic. They have street prices in the range of $300 to $850. The less expensive versions mainly provide virtual memory compatibility, since the “acceleration” is usually only 20–40%. The more expensive versions can triple (or more) the speed of typical operations. You get what you pay for. You often also get Compact Virtual for free since it’s bundled with most 68030 accelerators.
The Classic II and SE/30 are different from the Plus, SE and Classic, having ROM software more like the Modular Macs. With no additional software, up to 8MB of memory can be addressed in 24–bit mode on these two systems, while only 4MB can be addressed using the other Compact Macs. So, for example, if you put a total of 10MB of RAM (adding two 4MB SIMMs) in a Classic II running System 7 with 32–bit addressing off, you would get 8MB of application memory. Turning 32–bit addressing on would let you access all 10MB. Similarly, if you install a memory card holding two 4MB SIMMs on a Classic (for a total of 10MB), you would only get 4MB of application memory. By installing Compact Virtual and a 68030 accelerator you could address up to 16MB on the accelerator board.
To get 32–bit addressing on an SE/30 you need System 7 and MODE32. 32–bit mode is standard with System 7 on the Classic II. It is not available at all on the Plus, SE or Classic.
RAM Caches, Disks, and Drives
We described how information has to be brought from the hard drive into RAM before it can be used by the CPU. Once executed, these instructions may be pushed out of RAM if the space is required to hold other information. Then, if these instructions are needed again, they must once more be copied from the hard drive. But instructions are often used repeatedly in short intervals (“loops” in the program, for example). So, the Mac contains a built–in adjustable RAM cache where information that was recently brought up from the hard drive can be stored in SIMM RAM. This speeds up access when recently used information is needed again right away.
You can change the size of this cache in the control panel. However, increasing the RAM cache beyond some point, typically 128K, yields diminishing returns, and becomes a waste of potential application memory. The RAM cache is worth using but don’t expect dramatic results. Usually it speeds things up no more than 5–15%.
This caching technique is used two more times on the Mac in caches that get progressively smaller, faster, and closer to the core of the processor itself. First, the Mac IIci and some IIsi math coprocessor cards support an add–on memory cache which can remember a small number of recently used instructions. It stores them in special RAM that can be accessed by the CPU even faster than data held in SIMM RAM. Memory caches produce surprisingly big speed improvements, often in the range of 15–30%. And since you add RAM, this cache does not reduce the amount of available application memory. The IIfx has a built–in cache with 64K of memory.
Second, the processor itself often has a built–in cache that stores a very small number of recently used instructions. The 68020 has a 256 byte cache for instructions, the 68030 has two 256 byte caches (one for instructions and one for data), and the 68040 has two 4 kilobyte (4K) caches. (The 68000 does not have one.) Surprisingly, though 256 bytes is not enough space to hold even this one paragraph, the 68020 cache contains the information sought by the processor about 20% of the time. Computers do a lot of repetitive work!
A RAM disk is a portion of the installed RAM which is not used for application memory, and instead is configured to work like a hard drive. RAM disks typically look like a hard drive on the desktop, and information can be added, accessed, modified, or removed in the same way as a hard drive, but at RAM speeds. RAM disks are a good place for large files that are frequently accessed.
The traditional problem with RAM disks is that the contents are erased whenever power is turned off. The MAXIMA RAM disk solves this problem by maintaining a copy of the RAM disk contents on the hard drive, thus preserving the information whenever the system is shut down. It then automatically copies this information back up from the hard drive into the RAM disk when the Mac is rebooted. The MAXIMA RAM disk contents will also survive a crash or a Restart, as long as power is not interrupted. MAXIMA also can store its information in a compressed state, so, for example, 5MB of RAM can create a 10MB RAM disk. A compressed RAM disk is slower than an uncompressed disk, but still a lot faster than a typical hard drive.
MAXIMA can often be used with RAM cards, which are NuBus cards populated with large quantities of RAM. RAM cards are usually used when the SIMM banks are completely filled, access to them is blocked by add on cards, or they are otherwise not useful.
A RAM drive is a SCSI device, that is it is connected to the Mac in the same way an external hard drive is. Instead of having a spinning platter like a hard drive, it contains lots of RAM. RAM drives are expensive but they can be a lot faster than the very fastest ordinary hard drives. They are usually not as fast as RAM disks built out of SIMM RAM since they are slowed down by the data transfer through the SCSI connection.
Bad Memory
When you power up your Mac (perform a “cold start”), it performs a comprehensive memory test. Basically it tries to write information to all the address locations in the entire installed RAM and then performs an operation (called an XOR) on the contents to see if it produces the correct result. It then writes the opposite pattern (0’s where there were 1’s before and vice versa) and tests again. If it gets correct results both times, it validates the RAM. When you do a Restart (a “warm boot”) without interrupting power, a much more limited test is performed.
In either case, if the Mac finds a problem before it validates enough memory to run the monitor, it gives a four note chime, colorfully known as the “Chimes of Death.” If it finds a problem after it validates enough memory to run the monitor, you get the Unhappy Mac image on the screen (along with codes that might tell a programmer something about what went wrong).
There are several possible explanations. If you have just changed the RAM configuration in your Mac, or have just moved the Mac, it probably means the RAM is not securely seated in the SIMM sockets or slots. Try wiggling each SIMM a little and gently pressing it a little harder into the socket. If this doesn’t help, carefully remove the SIMMs and put them back in. If you still have problems, make sure you followed the Four SIMM Rules, have the right RAM for your machine (for example, PAL SIMMs for a II or IIx if they are over 1MB), and don’t have any obvious other culprits (like a loose add–on accelerator card.) If you get this far, you probably have at least one defective SIMM. If possible, try to boot you Mac with a different set of RAM and then use a process of swapping and elimination to find the bad SIMM. SIMMs don’t go bad often and when they do it is usually because they have recently been physically handled.
It is possible for software to cause memory problems, too, although this is extremely rare. If your RAM seems to be OK, try turning off as many extensions as possible, reinstalling your System and running a virus checker.